#pragma once

#include "Common.h"

class CentralCache
{
public:
	static CentralCache* GetInstance()
	{
		return &_sInst;
	}

	Span* GetOneSpan(SpanList& list, size_t size);

	size_t FetchRangeObj(void*& start, void*& end, size_t n, size_t size);

	void ReleaseListToSpans(void* start, size_t size);
private:
	SpanList _spanLists[NFREELIST];


private:
	CentralCache()
	{}

	CentralCache(const CentralCache&) = delete;

	~CentralCache()
	{}

	static CentralCache _sInst;
};